import { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { RoutePaths } from '../../config';

const Home = () => {
    const navigate = useNavigate();
    const { pathname } = useLocation();

    useEffect(() => {
        pathname !== RoutePaths.home && navigate(RoutePaths.home, {
            replace: true
        });
    }, [pathname, navigate]);

    return (
        <div>
            <h1>Hello~</h1>
        </div>
    );
}

export default Home;